<template>
	<view class="yyWrap">
		<view class="zxsList hasBg"
			v-for="(item,index) in zxsList"
			:key="index"
			@tap="goYyDet(item.id)"
		>
			<view class="header">
				<image class="samePar" mode="aspectFill" v-if="item.headImg == ''" :src="defHead"></image>
				<image class="samePar" mode="aspectFill" v-else :src="getCloudFilePath(item.headImg)"></image>
			</view>
			<view class="zxsInfo">
				<view class="zxsName spaceBet">
					<view class="alignCen">
						<view class="user">{{item.userName}}</view>
					</view>
					
					<view class="status wait" v-if="item.zxStatus == 1">待咨询</view>
					<view class="status comp" v-if="item.zxStatus == 6">已完成</view>
					<view class="status cancel" v-if="item.zxStatus == 7">已取消</view>
				</view>
				<view class="time">下单时间：{{item.addTime}}</view>
				<view class="time" :class="[item.zxStatus == 1 ? 'wait' : '']">咨询时间：{{item.zxTime}}</view>
				<view class="time">咨询方式：面对面咨询</view>
				<view class="addReport">
					<template v-if="fromPage == 'zxRec' && item.zxStatus == 1">
						<view class="comBtn" @tap.stop="goAddReport(item,'add')">填写报告</view>
					</template>
					<template v-if="fromPage == 'yyRec' && item.zxStatus == 1">
						<view class="comBtn view"  @tap.stop="cancelYy(item.id)">取消预约</view>
					</template>
					<!-- <view class="comBtn view" @tap="goAddReport(item.id,'view')" v-if="fromPage == 'zxRec' && item.zxStatus == 6">查看报告</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			fromPage:String,
			zxsList:Array
		},
		data(){
			return{
				defHead:this.defHead
			}
		},
		methods:{
			goYyDet(orderId){
				this.$emit('goYyDet',orderId);
			},
			goAddReport(item,opt){
				this.$emit('goAddReport',item,opt);
			},
			cancelYy(orderId){
				this.$emit('cancelYy',orderId);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.yyWrap{
		padding-top: 20rpx
	}
	.addReport{
		width: 100%;
		display: flex;
		justify-content: flex-end;
		margin-top: 15rpx;
		.comBtn{
			width: 140rpx;
			height: 54rpx;
			line-height:54rpx;
			font-size: 26rpx;
			border-radius: 8rpx;
			font-size: 26rpx;
			&.view{
				background: #DAE6FE;
				color: $pss-color-blueDeep;
				border: 1rpx solid $pss-color-blueDeep;
			}
		}
	}
	@import '../../../../static/scss/zxsList.scss';
</style>